import React,{useState,useEffect} from "react";
import "../../../styles/DepositList.scss";
import { issue_list } from "../../../utils/api/index";
import DepositListtop from "./DepositView/DepositListtop"
import DepositListbtm from "./DepositView/DepositListbtm"
interface Props {}

function DepositList(props: Props) {
  var [depositlist, setDepositlist]:any = useState([]);
  //列表渲染
  useEffect(() => {
    issue_list().then((res) => {
      // console.log(res.data);
      setDepositlist(res.data);
    });
  }, []);
  const changedepositlist= (data: []) => {
    setDepositlist(data)
}

  return (
    <div className="depositlist">
       <DepositListtop changedepositlist={changedepositlist} />
       <DepositListbtm depositlist={depositlist}/>
    </div>
  );
}

export default DepositList;
